package com.jcl.recruit.user.dao;

import com.jcl.core.db.DatabaseContext;
import com.jcl.recruit.user.mapper.UserResumeAttentionMapper;
import com.jcl.recruit.user.model.UserResumeAttention;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;


@Component
public class UserResumeAttentionDao implements UserResumeAttentionMapper {

    @Autowired
    private UserResumeAttentionMapper userResumeAttentionMapper;


    @Override
    public List<UserResumeAttention> getListBySearchResumeIds(Integer userId, List<Integer> searchResumeIds) {
        DatabaseContext.setCurrentContext();
        return userResumeAttentionMapper.getListBySearchResumeIds(userId, searchResumeIds);
    }

    @Override
    public List<UserResumeAttention> getListBySearchResumeId(Integer userId, Integer searchResumeId) {
        DatabaseContext.setCurrentContext();
        return userResumeAttentionMapper.getListBySearchResumeId(userId, searchResumeId);
    }

    @Override
    public List<UserResumeAttention> getListByUserId(Integer userId) {
        DatabaseContext.setCurrentContext();
        return userResumeAttentionMapper.getListByUserId(userId);
    }

    @Override
    public List<UserResumeAttention> getListByResumeId(Integer userId, Integer resumeId) {
        DatabaseContext.setCurrentContext();
        return userResumeAttentionMapper.getListByResumeId(userId, resumeId);
    }

    @Override
    public List<UserResumeAttention> getListByOtherJid(Integer userId, String otherJid) {
        DatabaseContext.setCurrentContext();
        return userResumeAttentionMapper.getListByOtherJid(userId, otherJid);
    }

    @Override
    public UserResumeAttention findOne(Integer id) {

        DatabaseContext.setCurrentContext();
        return userResumeAttentionMapper.findOne(id);
    }

    @Override
    public int update(Integer id, Integer status) {
        DatabaseContext.setCurrentContext();
        return userResumeAttentionMapper.update(id, status);
    }

    @Override
    public int add(UserResumeAttention attention) {
        DatabaseContext.setCurrentContext();
        return userResumeAttentionMapper.add(attention);
    }
}
